############################################################################
#
#  Program:         OpenSMOKE
#
#  Module:          make.inc
#
#  Purpose:         Top-level Definitions
#
#  Creation date:   January 9 2010
#
############################################################################

#  Compiler:   intel || gnu

COMPILER_NAME  	      = gnu

BZZ_PATH 	       =  ${HOME}/NumericalLibraries/BzzMath6
OPENSMOKE_PATH         =  ../../../../../../OpenSMOKE/OpenSMOKE

#Paths 
NUMERICALRECIPES_PATH  =  ${HOME}/NumericalLibraries/NumericalRecipes
LIS_PATH               =  ${HOME}/NumericalLibraries/lis-1.2.62/lis-omp-complete
MUMPS_PATH             =  ${HOME}/NumericalLibraries/MUMPS/MUMPS_4.9.2_SEQ_MKL_PORD
METIS_PATH             =  ${HOME}/NumericalLibraries/metis-5.0.2
BLAS_PATH              =  #{HOME}/NumericalLibraries/GotoBLAS2
SYSTEM_LIB_PATH        =  /usr/lib/x86_64-redhat-linux5E/lib64/

#Options
OPTIONS_INTEL   =  -O3 -DUSE_INTEL_MKL=1 -openmp -I/usr/include/x86_64-linux-gnu/c++/4.8
OPTIONS_GNU     =  -O3 -m64 -Wall -fexpensive-optimizations -funroll-loops -DUSE_INTEL_MKL=1 -fopenmp

# ------------------------------------------------------------------------------------------------
# LIBRARY NAMES
# ------------------------------------------------------------------------------------------------

#BzzMath Libraries
BZZ_LIBS_INTEL  = -lBzzMath6_INTEL_MKL_MT
BZZ_LIBS_GNU    = -lBzzMath6_GNU_MKL_MT

#NR libraries
NR_LIBS_INTEL   =  -lNumericalRecipes_INTEL   
NR_LIBS_GNU     =  -lNumericalRecipes_GNU

#MUMPS libraries
MUMPS_LIBS      = -ldmumps -lmumps_common -lpord $(MUMPS_PATH)/libseq/libmpiseq.a 
LIS_LIBS        = -llis
METIS_LIBS      = -lmetis
BLAS_LIBS       = 

# ------------------------------------------------------------------------------------------------
# COMPILERS
# ------------------------------------------------------------------------------------------------
ifeq ($(COMPILER_NAME),intel)

OBJ_PATH    = intel_mkl_mt
STRING_NAME = INTEL_MKL_MT
CXX         = icpc
CXX_FLAGS   = $(OPTIONS_INTEL) -static
BZZ_LIBS    = $(BZZ_LIBS_INTEL)
NR_LIBS     = $(NR_LIBS_INTEL)

endif	

ifeq ($(COMPILER_NAME),gnu)

OBJ_PATH    = gnu_mkl_mt
STRING_NAME = GNU_MKL_MT
CXX         = g++
CXX_FLAGS   = $(OPTIONS_GNU) -static
BZZ_LIBS    = $(BZZ_LIBS_GNU) 
NR_LIBS     = $(NR_LIBS_GNU)

endif	

# ------------------------------------------------------------------------------------------------
# INCLUDE
# ------------------------------------------------------------------------------------------------
BZZ_INCLUDE          = -I$(BZZ_PATH)/hpp
MKL_INCLUDE          = -I$(MKL_PATH)/include
MKL_ROOT	     =   ${MKL_PATH}
NR_INCLUDE           = -I$(NUMERICALRECIPES_PATH)/hpp
OPENSMOKE_INCLUDE    = -I$(OPENSMOKE_PATH)/hpp
MUMPS_INCLUDE        = -I$(MUMPS_PATH)/include
LIS_INCLUDE          = -I$(LIS_PATH)/include
METIS_INCLUDE        = -I$(METIS_PATH)/include

# ------------------------------------------------------------------------------------------------
# LIBRARY PATHS
# ------------------------------------------------------------------------------------------------
BZZ_PATH_LIB           = $(BZZ_PATH)/lib/release
NR_PATH_LIB            = $(NUMERICALRECIPES_PATH)/lib/release
OPENSMOKE_PATH_LIB     = $(OPENSMOKE_PATH)/lib/linux/$(OBJ_PATH)
MKL_PATH_LIB           = $(MKL_PATH)/lib/intel64
MUMPS_PATH_LIB         = $(MUMPS_PATH)/lib
LIS_PATH_LIB           = $(LIS_PATH)/lib
METIS_PATH_LIB         = $(METIS_PATH)/lib
BLAS_PATH_LIB          = $(BLAS_PATH)


ifeq ($(COMPILER_NAME),intel)
MKL_LIBS        =  -Wl,--start-group $(MKL_ROOT)/lib/intel64/libmkl_intel_lp64.a $(MKL_ROOT)/lib/intel64/libmkl_core.a $(MKL_ROOT)/lib/intel64/libmkl_intel_thread.a -Wl,--end-group  -L$(SYSTEM_LIB_PATH)
endif

ifeq ($(COMPILER_NAME),gnu)
MKL_LIBS        =  -Wl,--start-group $(MKL_ROOT)/lib/intel64/libmkl_intel_lp64.a $(MKL_ROOT)/lib/intel64/libmkl_core.a $(MKL_ROOT)/lib/intel64/libmkl_gnu_thread.a -Wl,--end-group -ldl  -L$(SYSTEM_LIB_PATH)
endif
 


 





